{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "a12cfe0d",
   "metadata": {},
   "source": [
    "#### \"plist\"发生了什么？"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "id": "3942f0c1",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Don't panic!\n",
      "['D', 'o', 'n', \"'\", 't', ' ', 'p', 'a', 'n', 'i', 'c', '!']\n"
     ]
    }
   ],
   "source": [
    "phrase = \"Don't panic!\"\n",
    "plist = list(phrase)\n",
    "print(phrase)\n",
    "print(plist)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "id": "10f1daa0",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['D', 'o', 'n', \"'\", 't', ' ', 'p', 'a', 'n', 'i', 'c']\n",
      "['D', 'o', 'n', \"'\", 't', ' ', 'p', 'a', 'n', 'i']\n",
      "['D', 'o', 'n', \"'\", 't', ' ', 'p', 'a', 'n']\n",
      "['D', 'o', 'n', \"'\", 't', ' ', 'p', 'a']\n"
     ]
    }
   ],
   "source": [
    "for i in range(4):\n",
    "    plist.pop()\n",
    "    print(plist)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "id": "03d4953f",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['o', 'n', \"'\", 't', ' ', 'p', 'a']\n"
     ]
    }
   ],
   "source": [
    "plist.pop(0)\n",
    "print(plist)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "id": "06e1131f",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['o', 'n', 't', ' ', 'p', 'a']\n"
     ]
    }
   ],
   "source": [
    "plist.remove(\"'\")\n",
    "print(plist)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "id": "97335171",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['o', 'n', 't', ' ', 'p', 'a']\n"
     ]
    }
   ],
   "source": [
    "plist.extend([plist.pop(),plist.pop()])\n",
    "print(plist)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "id": "f76c5c41",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['o', 'n', ' ', 't', 'p', 'a']\n"
     ]
    }
   ],
   "source": [
    "plist.insert(2,plist.pop(3))\n",
    "print(plist)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ad59e0c6",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
